const ProjectUrl = {
  'pf-gateway': process.env.VUE_APP_BASE_URL,
  'pf-system': process.env.VUE_APP_SYSTEM_URL,
  'pf-camunda': process.env.VUE_APP_CAMUNDA_URL,
  'pf-auth': process.env.VUE_APP_AUTH_URL
};
module.exports = function getProxyApi() {
  const api = {};
  for (const key in ProjectUrl) {
    console.log(key);
    api[`/${key}-api`] = {
      target: ProjectUrl[key], //代理地址
      changeOrigin: true, // 如果接口跨域，需要进行这个参数配置
      //ws: true, // proxy websockets
      //pathRewrite方法重写url
      pathRewrite: {
        [`^/${key}-api`]: ``
      }
    };
  }
  return api;
};
